import strMessageItemHtml from "./MessageItem.html";
import { DomUtils } from "../../../utils/DomUtils";

export class MessageItem {
  constructor(message) {
    this.message = message;
  }

  render() {
    let strHtml = strMessageItemHtml;
    strHtml = strHtml.replace("{{icon}}", this.message.icon);
    strHtml = strHtml.replace("{{sender}}", this.message.sender);
    strHtml = strHtml.replace("{{title}}", this.message.title);
    strHtml = strHtml.replace("{{content}}", this.message.content);
    return DomUtils.convertToDom(strHtml);
  }
}
